﻿namespace WMS6.Web.Inventory
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class CCMaintenanceQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnSearch;
        protected DropDownList ddlCreatedBy;
        protected DropDownList ddlLoc;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlReleaseDate;
        protected DropDownList ddlReleaseID;
        protected DropDownList ddlSkuID;
        protected DropDownList ddlStatus;
        protected HtmlForm F5530;
        protected HtmlHead Head1;
        protected Label lblCreatedBy;
        protected Label lblLoc;
        protected Label lblOwnerID;
        protected Label lblReceiptQuery;
        protected Label lblReleaseDate;
        protected Label lblReleaseID;
        protected Label lblSkuID;
        protected Label lblStatus;
        protected HtmlLink mycss;
        protected TextBox txtCreatedBy;
        protected TextBox txtLoc;
        protected TextBox txtOwnerID;
        protected TextBox txtReleaseDate;
        protected TextBox txtReleaseID;
        protected TextBox txtSkuID;
        protected TextBox txtStatus;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("CCMaintenanceList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlReleaseID, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlSkuID, 0);
            base.InitQueryDDL(this.ddlLoc, 0);
            base.InitQueryDDL(this.ddlCreatedBy, 0);
            base.InitQueryDDL(this.ddlReleaseDate, 1);
            base.InitQueryDDL(this.ddlStatus, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            base.InitPage(this.Page);
            this.InitDropDownLists();
        }

        public string CreateBy
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtCreatedBy.Text.Trim()))
                {
                    return base.GetParamsString(this.txtCreatedBy.Text.Trim(), this.ddlCreatedBy.SelectedValue);
                }
                return "";
            }
        }

        public string Loc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLoc.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLoc.Text.Trim(), this.ddlLoc.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string ReleaseDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReleaseDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReleaseDate.Text.Trim(), this.ddlReleaseDate.SelectedValue);
                }
                return "";
            }
        }

        public string ReleaseID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReleaseID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReleaseID.Text.Trim(), this.ddlReleaseID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuID.SelectedValue);
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtStatus.Text.Trim()))
                {
                    return base.GetParamsString(this.txtStatus.Text.Trim(), this.ddlStatus.SelectedValue);
                }
                return "";
            }
        }
    }
}

